package org.jfsm.log;

import java.util.ArrayList;

public abstract class Logger {
    protected final boolean enabled;

    ArrayList<LogSource> sources = new ArrayList<LogSource>();

    public abstract void log(String str);
    
    public void register(LogSource logSource) {
    	sources.add(logSource);
    	logSource.setEnabled(enabled);
    }

	public void setAsDefault() {
		LogSource.setDefaultLogger(this);
	}

    Logger(boolean enabled) {
    	this.enabled = enabled;
    }
}